///************************************************************************
/// <copyrigth>2018-2019 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// It is duty for activating app's debug mode and starting app
///</describe>
/// <date>2020/7/26</date>
///***********************************************************************
#ifndef PROGRAM_H
#define PROGRAM_H

#include "App.h"

class Program
{
public:
	// Construct the app front
	Program();

	// Detructe the app front
	~Program();

private:
	// Forbid the copy app front
	Program(const Program& other) {	};

	// Forbid the assigment of app front
	Program& operator=(const Program& other) { return *this; };

public:
	// Start the app
	bool Start();

	// Stop the app
	bool Stop();

private:
	// Start the app
	bool StartApp();

	// Stop the app
	bool StopApp();

	// Is debug mode
	bool IsDebugMode();

	// Configure console window
	void ConfigConsole();

private:
	// Initialize the app front
	void Initialize();

	// Destory the app front
	void Destory();

	// Create the app
	void CreateApp();

	// Destory the app
	void DestoryApp();

	// Create console
	void CreateConsole();

	// Destory the console
	void DestoryConsole();

private:
	// Get App
	inline App* GetApp() const
	{
		return m_pApp;
	}

	// Set App
	inline void SetApp(App* pApp)
	{
		m_pApp = pApp;
	}

	// Get the disposed status
	inline bool GetDisposed() const
	{
		return m_bDisposed;
	}

	// Set the disposed status
	inline void SetDisposed(bool bDisposed)
	{
		m_bDisposed = bDisposed;
	}

private:
	// App
	App* m_pApp;

	// Disposed status
	bool m_bDisposed;
};

#endif // PROGRAM_H
